home *** CD-ROM | disk | FTP | other *** search
- #define MYVERSION "Version x.xx"
- #include <stdio.h>
- #include <hamdefs.h>
-
- extern int terminate();
- extern int _cbrkflg;
-
- char *options[] = {
- "Read WARNING message",
- "Read \"What is interleave?\"",
- "Read \"Why change interleave?\"",
- "Select the disk drive",
- "Execute interleave adjustment",
- "Exit this program",
- NULL
- };
-
- int drive_to_use=0x80;
- int have_selected=0;
- int factor;
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- static int colarray[]={39};
- int choice;
- char temp[80];
-
- if(argc==2)
- sscanf(argv[1],"%d",&factor);
-
- if(factor<1 || factor>16 || argc!=2)
- factor=5;
-
- clrscn();
- scrbox(0,0,23,79,2,NORMAL|HILITE);
- center(06,"MEMTEC Corporation");
- center(07,"Salem, NH U.S.A. 03079");
- center(08,"(603) 893-8080");
- center(10,"Interleave Adjust Utility (IAU.EXE)");
- center(12,"(c) 1986 MEMTEC Corp. All Rights Reserved");
- center(13,MYVERSION);
-
- locate(17,5);
- keyboard(); /* press a key */
-
- clrscn();
-
- _cbrkflg=FALSE;
- intrinit(terminate,0x800,0x23);
-
- scrtable(0,0,23,78,3,NORMAL|HILITE,5,7,-1,1,colarray);
-
- atputsa(1,37,"Status",NORMAL|HILITE);
- atputsa(6,15,"Selection",NORMAL|HILITE);
- atputsa(6,54,"Information",NORMAL|HILITE);
-
- type("warning.doc",10,43,20,75);
-
- locate(9,5);
-
- choice=0;clrkey();
- while((choice=getbar(options,choice))!=5) {
- switch(choice) {
- case 0: type("warning.doc",10,43,20,75);
- break;
- case 1: type("ileave.doc",10,43,20,75);
- sprintf(temp,"Interleave selected: %d",factor);
- atputsha(21,42,temp);
- break;
- case 2: type("change.doc",10,43,20,75);
- break;
- case 3: sel_disk();
- break;
- case 4:
- atputsha(17,45,"Started at ");
- showtime(17,58);
- rfw();
- atputsha(13,45,"Complete at ");
- showtime(13,58);
- choice=5;
- break;
- case 5:
- default: break;
- }
- clrblk(1,1,4,77);
- atputsa(1,37,"Status",NORMAL|HILITE);
- center(3,"Complete");
- locate(9,5);
- clrkey();
- }
-
- locate(23,0);
- intrrest(0x23);
- exit(0);
- }
-
- char *pick_disk[] = {
- "Select the first hard disk drive ",
- "Select the second hard disk drive",
- NULL
- };
-
- sel_disk()
- {
- struct {int ax,bx,cx,dx,si,di,ds,es;}r;
- int count;
- char temp[80];
-
- segread(&r.si);
- r.ax=0x0800;
- r.bx=r.cx=0;
- r.dx=drive_to_use;
- if(1&sysint(0x13,&r,&r)) {
- atputsa(2,25,"Unable to address hard disk(s)",NORMAL|HILITE);
- beep();
- return 1;
- }
- count=r.dx&0x0f;
-
- atputsha(22,42,"Drive selected: ");
- switch(count) {
- case 0: center(3,"No hard disk drives in your system");
- break;
- case 1:
- break;
- case 2:
- locate(19,5);
- drive_to_use=0x80+getbar(pick_disk,0);
- clrblk(18,4,22,5+strlen(pick_disk[0]));
- break;
- default:
- clrscn();
- atputsa(5,5,"Congratulations! You have more than two hard",NORMAL|HILITE);
- atputsa(6,5,"disks responding, and that BREAKS this program.",NORMAL|HILITE);
- locate(23,0);
- intrrest(0x23);
- exit(9);
- break;
-
- }
- sprintf(temp,"%02d",drive_to_use-0x80);
- atputsa(22,58,temp,NORMAL|HILITE);
- have_selected=1;
- }
-
-